import java.io.IOException;
import java.sql.SQLException;

import javax.naming.NamingException;


/**
 * @author Yin Zhang, 5393558
 * @version 0.1, 07 May 2008, initial creation
 */
public class RunBuild002Staff
{	
	public static void main(String[] args) throws SQLException, NamingException, IOException
	{
		StaffUserStory4 sus4 = null;
		StaffUserStory5 sus5 = null;
		StaffUserStory6 sus6 = null;
		try
		{
			if (args.length == 4)
			{
				if(!args[3].endsWith(".zip"))
				{
					throw new IllegalArgumentException("Only zip filesaccepted");
				}
				else
				{
					sus5 = new StaffUserStory5();
					sus5.createNewAssignment(args);
				}
			}
			else if(args.length == 5)
			{
				sus6 = new StaffUserStory6();
				sus6.createNewExtension(args);
			}
			else if(args.length == 7)
			{
				sus4 = new StaffUserStory4();
				sus4.createNewSubject(args);
			}
		}
		finally
		{
			if(sus4 != null)
			{
				sus4.close();
			}
			
			if(sus5 != null)
			{
				sus5.close();
			}
			
			if(sus6 != null)
			{
				sus6.close();
			}
		}
	}
}